import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class No3 {
    public static void main(String[] args) {
        System.out.println(No3.lengthOfLongestSubstring("au"));


    }
    public static int lengthOfLongestSubstring(String s) {

        if (s.length() == 1) {
            return 1;
        } else {
            int max = 0;
            for (int i = 0; i < s.length(); i++) {
                List<Character> list = new ArrayList<>();
                int cout = 0;
                for (int j = i; j < s.length() ; j++) {
                    Character c = s.charAt(j);
                    if (list.contains(c)) {
                        break;
                    } else {
                        cout++;
                        list.add(c);
                    }
                }
                max = max > cout ? max : cout;
            }
            return max;
        }
    }
}
